<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<meta charset="utf-8">
<head th:include="include :: header"></head>
<link th:href="@{/mayioa/css/mayioa-ui.css}" rel="stylesheet"/>
<link th:href="@{/ajax/libs/datapicker/datepicker3.css}" rel="stylesheet"/>
<body class="white-bg">
	<div class="wrapper wrapper-content animated fadeInRight ibox-content">
		<form class="form-horizontal m" id="form-pool-edit" th:object="${poolInfo}">
			<input name="poolRecordId"  type="hidden"  th:field="*{poolRecordId}" />
			<div class="form-group">
				<label class="col-sm-3 control-label ">用户工号：</label>
				<div class="col-sm-8">
					<input class="form-control" name="poolUserId"  type="text" readonly="true" th:field="*{poolUserId}"/>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label ">用户名：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" readonly="true" th:field="*{userName}"/>
				</div>
			</div>

			<div class="form-group">
				<label class="col-sm-3 control-label">是否骨干：</label>
				<div class="col-sm-8">
					<select id="poolIsBackbone" class="form-control m-b" th:with="type=${@dict.getType('pool_mgr_isbone')}">
						<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{poolIsBackbone}"></option>
					</select>
				</div>
			</div>

			<div class="form-group">
				<label class="col-sm-3 control-label">进骨干池原因：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="poolInDesc" id="poolInDesc" th:field="*{poolInDesc}">
				</div>
			</div>

			<div class="form-group">
				<label class="col-sm-3 control-label">出骨干池原因：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="poolOutDesc" id="poolOutDesc" th:field="*{poolOutDesc}">
				</div>
			</div>

		</form>
	</div>
	<div th:include="include::footer"></div>
	<script th:src="@{/ajax/libs/select/select2.js}"></script>
	<script th:src="@{/js/jquery-ui-1.10.4.min.js}"></script>
	<script th:src="@{/ajax/libs/iCheck/icheck.min.js}"></script>
	<script th:src="@{/ajax/libs//datapicker/bootstrap-datepicker.js}"></script>
	<script th:src="@{/ajax/libs/beautifyhtml/beautifyhtml.js}"></script>
	<script>

        function submitHandler() {
	        	edit();
	    }

        function edit() {
        	var poolRecordId = $("input[name='poolRecordId']").val();
        	var poolUserId = $("input[name='poolUserId']").val();
        	var poolIsBackbone = $("#poolIsBackbone option:selected").val();
        	var poolInDesc = $("input[name='poolInDesc']").val();
        	var poolOutDesc = $("input[name='poolOutDesc']").val();

        	$.ajax({
        		cache : true,
        		type : "POST",
        		url : ctx + "pool/manual/edit",
        		data : {
        			"poolRecordId": poolRecordId,
        			"poolUserId": poolUserId,
        			"poolIsBackbone": poolIsBackbone,
        			"poolInDesc": poolInDesc,
        			"poolOutDesc": poolOutDesc
        		},
        		async : false,
        		error : function(request) {
        			$.modal.alertError("系统错误");
        		},
        		success : function(data) {
        			$.operate.saveSuccess(data);
        		}
        	});
        }
    </script>
</body>
</html>
